package com.saint.farmshop.Entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * 产品Entity
 *
 * @author Saint
 * @date 2022/05/22
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
public class Production implements Serializable {

    @Id
    private String id;

    private String coverImg;

    private String productionName;

    private Double price;

    private String typeId;

    private String openId;

    private Integer status;

    public Production(ProductionDetail productionDetail){
        System.out.println(productionDetail);
        this.id = productionDetail.getId();
        this.coverImg = productionDetail.getImgList().get(0);
        this.productionName = productionDetail.getProductionName();
        this.price = productionDetail.getPrice();
        this.typeId = productionDetail.getTypeId();
        this.status = productionDetail.getStatus();
        this.openId = productionDetail.getOpenId();
    }
}
